package com.bbx.taxi.client.Util;

import android.app.Activity;
import android.content.Intent;
import com.bbx.taxi.client.Activity.Order.OrderCancelReason;
import com.bbx.taxi.client.Activity.Order.OrderDelete;
import com.bbx.taxi.client.Activity.Order.OrderEvaluationActivity2;
import com.bbx.taxi.client.Activity.Order.StartServiceActivity;
import com.bbx.taxi.client.Bean.Value;
import com.bbx.taxi.client.Bean.Extra.OrderMsg;

/** 
 * @Path com.bbx.taxi.client.Util.StartOrderUtils.java
 * @Author 严旭文
 * @Date 2016-7-18 下午3:28:01
 * @Company 蓝海（福建）信息技术有限公司
 * @Description
 * 根据订单类型跳转
 */
public class StartOrderUtils {
   public static void onStartOrder(Activity context,int order_status,String order_id,int requestCode){
		if(order_status<Value.ORDER_STATUS_OFFCAR||
				order_status==Value.ORDER_STATUS_GAIPAI||
				order_status==Value.ORDER_STATUS_KF_GAIPAI){
			Intent intent = new Intent(context, StartServiceActivity.class);
			intent.putExtra(OrderMsg.extra_type, 1);
			intent.putExtra(OrderMsg.extra_order_id, order_id);
			context.startActivityForResult(intent, requestCode);
			return;
		}
		else if(order_status==Value.ORDER_STATUS_FINISH||order_status==Value.ORDER_STATUS_OFFCAR){
		Intent intent = new Intent(context,
					OrderEvaluationActivity2.class);
			intent.putExtra(OrderMsg.order_id_finish, order_id);
			intent.putExtra(OrderMsg.finish_type,
					OrderMsg.finish_all);
			context.startActivityForResult(intent, requestCode);
			return;
		}
		else if(order_status==Value.ORDER_STATUS_CANCEL||order_status==Value.ORDER_STATUS_KF_CANCEL){
			Intent intent = new Intent(context,
					OrderCancelReason.class);
			intent.putExtra(OrderMsg.extra_order_id, order_id);
			context.startActivityForResult(intent, requestCode);
			return;
		}

		else if(order_status==Value.ORDER_STATUS_DELETE){
			Intent intent = new Intent(context,
					OrderDelete.class);
			context.startActivity(intent);
			return;
		}
		else{
		Intent intent = new Intent(context,
					OrderEvaluationActivity2.class);
			intent.putExtra(OrderMsg.order_id_finish, order_id);
			context.startActivityForResult(intent, requestCode);
			return;
		}
   }
}
